| lcPaint_ImageSetPixel | Home |
|
BOOL lcPaint_ImageSetPixel ( HANDLE hImage, int X, int Y, int Red, int Green, int Blue ); |
| hImage | |
| Handle to raster image object. | |
| X Y | |
| Pixel coordinates. | |
| Red Green Blue | |
| Color components (0-255). | |
| If the function succeeds, the return value is nonzero (TRUE). |
| lcPaint_ImageCreate |
//-----------------------------------------------
void LcAppDemo01::LoadImages ()
{
...
// programmatically generated image
hImage = lcPaint_ImageAdd( 41 );
W = 30;
H = 20;
lcPaint_ImageCreate( hImage, W, H );
// set pixels
B = 0;
srand( (unsigned)time(0) );
for (x=0; x<W; x++){
for (y=0; y<H; y++){
R = (int)(255.0 * ((double)rand()/RAND_MAX));
G = (int)(255.0 * ((double)rand()/RAND_MAX));
B = (int)(255.0 * ((double)rand()/RAND_MAX));
lcPaint_ImageSetPixel( hImage, x, y, R,G,B );
}
}
}